﻿<Window x:Class="Excel2SQLBulkTransfer.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Bulk Excel 2 SQL Import" Height="377" Width="716"
        Icon="/Images/bricks.png">
    
    <Grid>
        
        <DockPanel  LastChildFill="true">
            
            <Grid DockPanel.Dock="Top" VerticalAlignment="Top">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="2.5*"/>
                    <ColumnDefinition Width="*"/>
                </Grid.ColumnDefinitions>
                
                <Grid.RowDefinitions>
                    <RowDefinition/>
                    <RowDefinition/>
                    <RowDefinition/>
                </Grid.RowDefinitions>
                
                <Label Grid.Column="0" Grid.Row="0" VerticalContentAlignment="Center" Margin="3" IsHitTestVisible="False">Excel File Path:</Label>
                <TextBox Grid.Column="1" Grid.Row="0" Name="txtImportFilePath" VerticalContentAlignment="Center" Margin="3"></TextBox>
                <StackPanel Grid.Column="2" Grid.Row="0" Orientation="Horizontal" HorizontalAlignment="Center">
                    <Button Margin="3" Name="btnFileBrowse" Click="btnFileBrowse_Click" VerticalContentAlignment="Center" >Browse...</Button>
                    <Button Margin="3" Name="btnGet" Click="btnGet_Click" VerticalContentAlignment="Center" >Get Data</Button>
                </StackPanel>
                
                <Label Margin="3" VerticalAlignment="Center" Grid.Column="0" Grid.Row="1">Select a Worksheet :</Label>
                <ComboBox Grid.Column="1" Grid.Row="1" Margin="3" Name="cboWorkSheetList" IsEditable="True" />
                <GroupBox  HorizontalAlignment="Stretch" Grid.Column="0" Grid.Row="2" Grid.ColumnSpan="3" Header="DataBase Server Info :">
                    <Grid Margin="5" HorizontalAlignment="Center">
                        <Grid.ColumnDefinitions>
                            <ColumnDefinition Width="Auto"/>
                            <ColumnDefinition Width="400"/>
                        </Grid.ColumnDefinitions>
                        <Grid.RowDefinitions>
                            <RowDefinition/>
                            <RowDefinition/>
                            <RowDefinition/>
                        </Grid.RowDefinitions>
                        
                        <Label Grid.Column="0" Grid.Row="0" >DataBase Server :</Label>
                        <TextBox  Name="txtDBServer" Margin="3" Grid.Column="1" Grid.Row="0"></TextBox>
                        <Label Grid.Column="0" Grid.Row="1" >DataBase Name :</Label>
                        <ComboBox Name="cboDBDataBase" Margin="3" Grid.Column="1" Grid.Row="1" GotFocus="cboDBDataBase_GotFocus" IsEditable="True"></ComboBox>
                        <Label Grid.Column="0" Grid.Row="2"> DataBase Table :</Label>
                        <ComboBox Name="cboDBDtable" Margin="3" Grid.Column="1" Grid.Row="2" GotFocus="cboDBDtable_GotFocus" IsEditable="True"></ComboBox>
                    </Grid>    
                </GroupBox>
                
            </Grid>
        
            <DockPanel DockPanel.Dock="Bottom">
                <DockPanel.Resources>
                    <Style TargetType="{x:Type Button}">
                        <Setter Property="Margin" Value="20"/>
                    </Style>
                </DockPanel.Resources>

                <Grid>
                    
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition/>
                        <ColumnDefinition Width="2*"/>
                        <ColumnDefinition/>
                    </Grid.ColumnDefinitions>
                    
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                    </Grid.RowDefinitions>
                
                    <Button Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Left" Name="btnGuessSchema" Click="btnGuessSchema_Click">Guess Schema</Button>
                    <Button  Grid.Column="2"  VerticalAlignment="Center" HorizontalAlignment="Right" Click="Button_Click">Bulk Copy</Button>
                   </Grid>
            </DockPanel>
            
            <Grid Name="gPlaceHolder">
                
            </Grid>
        </DockPanel>
        
    </Grid>
</Window>
